
import request from '../../utils/request';

const department = {
    state: {
        department: []
    },
    mutations: {
        SET_Department: (state, departmentInfo) =>{
            state.department = departmentInfo
        }
    },
    actions: {
        getDepartment({ commit, state }) {
            return new Promise((resolve, reject) => {
                request({
                    url: "/department/findAll",
                    method: "get",
                }).then(data => {
                    commit('SET_Department', data.data);
                    resolve(data);
                }).catch(err => {
                    reject(err)
                })
            })

        }
    }
}
export default department